//提供 封装了 执行 登录 注册 相关功能的 异步请求的api方法
//导入 axios
import axios from "@/utils/request.js";

//按需导出 api方法

export const getCateList = (params) => axios({
    url: 'categories',
    params
})

export const addCate = (data) => axios({
    url: 'categories',
    method: 'post',
    data
})

export const chkCateById = (id) => axios({
    url:`categories/${id}`
})

export const subEditCate = (id,data) => axios({
    url: `categories/${id}`,
    method:'put',
    data
})

export const delCate = (id) => axios({
    url: `categories/${id}`,
    method:'delete'
})